var express = require('express');

var app = express();

app.get('/user/:id',function(req, resp, next){
    console.log("userId:" + req.params.id);
    next();
}, function(req, resp, next){
     resp.send("user info");
     next();
});

app.get('/user/:id', function(req, resp, next){
    console.log("/user/:id");
    resp.end(req.params.id);
});

//------------------------------------------------

app.get('/stu/:stuId', function(req, resp, next){
    if(parseInt(req.params.stuId) === 1) next('route');
    else next();
}, function(req, resp, next){
    resp.send('regular');
});

app.get('/stu/:stuId', function(req, resp, next){
    resp.send('special');
});

app.listen(3000, function(){
    console.log("Servler is running.");
})